import Vue from 'vue'
import Router from 'vue-router'
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component:()=> import('@/components/login'),
    },
    {
      path: '/tabbar',
      name: 'tabbar',
      component:()=> import('@/components/tabbar'), //底部tab
      children:[
        // {
        //   path:'',
        //   redirect:'/tabbar/home'
        // },
        {
          path:'/tabbar/home',
          name:"home",
          component:()=>import('@/components/home.vue')//首页
        },
        {
          path:'/tabbar/my',
          name:"my",
          component:()=>import('@/components/my.vue')//我的
        },
      ]
    }
    ,{
      path: '/fanDetail',
      name: 'fanDetail',
      component:()=> import('@/components/detail/fanDetail'),//扇子详情
    }
    ,{
      path: '/fanList',
      name: 'fanList',
      component:()=> import('@/components/detail/fanList'),//扇子合集
    }
    ,{
      path: '/collection',
      name: 'collection',
      component:()=> import('@/components/detail/collection'),//展品收藏
    }
    ,{
      path: '/placeOrder',
      name: 'placeOrder',
      component:()=> import('@/components/order/placeOrder'),//提交订单
    }
    ,{
      path: '/toPaid',
      name: 'toPaid',
      component:()=> import('@/components/order/toPaid'),//去支付
    }
    ,{
      path: '/success',
      name: 'success',
      component:()=> import('@/components/order/success'),//已完成
    }
    ,{
      path: '/myOrder',
      name: 'myOrder',
      component:()=> import('@/components/order/myOrder'),//我的订单
    }
    ,{
      path: '/set',
      name: 'set',
      component:()=> import('@/components/set/set'),//设置
    }
    ,{
      path: '/personal',
      name: 'personal',
      component:()=> import('@/components/set/personal'),//个人中心
    }
    ,{
      path: '/security',
      name: 'security',
      component:()=> import('@/components/set/security'),//账号与安全
    }
    ,{
      path: '/about',
      name: 'about',
      component:()=> import('@/components/set/about'),//账号与安全
    }
    ,{
      path: '/service',
      name: 'service',
      component:()=> import('@/components/set/service'),//客服
    }
    ,{
      path: '/phone',
      name: 'phone',
      component:()=> import('@/components/set/phone'),//更换手机号
    }
    ,{
      path: '/newphone',
      name: 'newphone',
      component:()=> import('@/components/set/newphone'),//更换手机号
    }
    ,{
      path: '/authentication',
      name: 'authentication',
      component:()=> import('@/components/set/authentication'),//实名认证
    }
    ,{
      path: '/payPassword',
      name: 'payPassword',
      component:()=> import('@/components/set/payPassword'),//支付密码
    }
    ,{
      path: '/acctPassword',
      name: 'acctPassword',
      component:()=> import('@/components/set/acctPassword'),//账号密码
    }
    ,{
      path: '/acctLogout',
      name: 'acctLogout',
      component:()=> import('@/components/set/acctLogout'),//账号密码
    }
    ,{
      path: '/newNickname',
      name: 'newNickname',
      component:()=> import('@/components/set/newNickname'),//修改昵称
    }
    ,{
      path: '/signName',
      name: 'signName',
      component:()=> import('@/components/set/signName'),//修改个性签名
    }
    ,{
      path: '/HelloWorld',
      name: 'HelloWorld',
      component:()=> import('@/components/HelloWorld'),
    }
  ]
})
